#include<bits/stdc++.h>

using namespace std;

class Solution {
public:
    int countConsistentStrings(string allowed, vector<string>& words) {
        int cnt = 0;
        for (string s : words)
        {
            int flag = 0;
            for (int i = 0; i < s.size(); i++)
            {
                if (allowed.find(s[i]) == string::npos)
                {
                    flag = 1;
                }
            }
            if (!flag)
            {
                cnt++;
            }
        }

        return cnt;
    }
};